home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Game-Power
/
Amiga Game-Power.iso
/
pd mix ii
/
access
/
hddriver
/
driver
/
libasm.asm
< prev
next >
Wrap
Assembly Source File
|
1994-05-20
|
2KB
|
117 lines
NOLIST
INCLUDE "exec/types.i"
INCLUDE "exec/alerts.i"
INCLUDE "exec/libraries.i"
INCLUDE "libraries/dos.i"
LIST
XREF _cLibInit
XREF _cOpen
XREF _cClose
XREF _cExpunge
XREF _cAbortIO
XREF _cBeginIO
XREF _SysBase
XREF _DOSBase
XREF _LVOOpenLibrary
XREF _LVOAlert
all reg d0/d1/a0/a1/a4/a6
most reg d1/a0/a1/a4/a6
; This routine gets called after the device has been allocated.
; The device pointer is in d0. The segment list is in a0. If it
; returns non-zero, the device will be linked into the device list.
dosName DOSNAME
XDEF _aLibInit
_aLibInit
movem.l a4/a6,-(sp) ; save registers that Aztec doesnt
move.l a0,-(sp) ; push segment list pointer
move.l d0,-(sp) ; push dev_ptr
move.l a6,_SysBase ; save pointer to exec
lea dosName(pc),a1 ; open DOS library
clr.l d0 ; library version number
CALLLIB _LVOOpenLibrary
move.l d0,_DOSBase ; save pointer to DOS
bne.s init_DosOK
ALERT AG_OpenLib!AO_DOSLib
clr.l d0 ; NULL means failed
bra.s init_end
init_DosOK
jsr _cLibInit ; cLibInit(dev_ptr,seg_list)
init_end
addq.l #4,sp ; dev_ptr in d0 if cLibInit() ok
move.l (sp)+,a0 ; get back seg_list
movem.l (sp)+,a4/a6 ; restore registers
rts
;
; Ok, now these are all simple little routines that save registers
; that may be damaged by the compiler then pushes the parameters onto
; the stack
;
XDEF _aOpen
_aOpen:
movem.l most,-(sp)
move.l d1,-(sp) ; push flags
move.l d0,-(sp) ; push unit number
move.l a1,-(sp) ; push request
move.l a6,-(sp) ; push device
jsr _cOpen
add.l #16,a7 ; remove parameters
movem.l (sp)+,most
rts
XDEF _aClose
_aClose:
movem.l most,-(sp)
move.l a1,-(sp) ; push request
move.l a6,-(sp) ; push device
jsr _cClose
addq.l #8,a7 ; remove parameters
movem.l (sp)+,most
rts
XDEF _aExpunge
_aExpunge:
movem.l most,-(sp)
move.l a6,-(sp) ; push device
jsr _cExpunge
addq.l #4,a7 ; remove parameters
movem.l (sp)+,most
rts
XDEF _aNull
_aNull:
clr d0
rts
XDEF _aBeginIO
_aBeginIO:
movem.l all,-(sp)
move.l a1,-(sp) ; push request
move.l a6,-(sp) ; push device
jsr _cBeginIO
addq.l #8,a7 ; remove parameters
movem.l (sp)+,all
rts
XDEF _aAbortIO
_aAbortIO:
movem.l all,-(sp)
move.l a1,-(sp) ; push request
move.l a6,-(sp) ; push device
jsr _cAbortIO
addq.l #8,a7 ; remove parameters
movem.l (sp)+,all
rts